home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: void main() and other atrocities!
- Date: 10 Feb 1996 19:25:28 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4fjnj8INNh3k@keats.ugrad.cs.ubc.ca>
- References: <4eduaj$1aq@grouper.Exis.Net> <4f7ifv$8l4@airdmhor.gen.nz> <4fg97qINNnug@keats.ugrad.cs.ubc.ca> <BLUME.96Feb9164215@zayin.cs.princeton.edu>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <BLUME.96Feb9164215@zayin.cs.princeton.edu>,
- Matthias Blume <blume@zayin.cs.princeton.edu> wrote:
- >In article <4fg97qINNnug@keats.ugrad.cs.ubc.ca> c2a192@ugrad.cs.ubc.ca
- >(Kazimir Kylheku) writes:
- >
- > Hence, declaring a void main(), while it is a
- > transgression, is not a very serious error.
- >
- >No, no, and no! It _is_ a serious error. Don't spread false
- >information, please! The C compiler is free to generate different
- >function *calling* (as opposed to "return") sequences for functions
- >declared as returning void and returning int. In this case already
- >the call to a "void" main can break something.
-
- Right, and as has been discussed before, most compilers are tacitly designed so
- that all the code out there which breaks the int main() rule works properly.
-
- Why I said that it is not a serious error is because it only affects the
- individual who is trying to compile one particular program. In case it doesn't
- work, it doesn't take a whole lot longer than ten seconds to correct. Most
- projects will not have more than just a small number main() routines.
-
- >Why, on earth, is it so hard to accept the fact that declaring main as
- >returning anything other than int in a hosted environment is ILLEGAL?
- >It *is* illegal. Period.
-
- Yes, but that does not make it serious. Stealing a candy from the grocery store
- is illegal, but hardly a grand felony. ;)
-
- There are more important issues in programming than worrying about correct
- declarations for main(). This should be a matter of good habit.
-
- --
-
-